<?php
namespace app\admin\form;

use app\common\loglic\Form;

class Upload extends Form
{
    public function items($data=[])
    {
        return [
            'path' => [
                'type'        => 'text',
                'value'       => $data['path'],
                'required'    => false,
                'title'       => '上传目录',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'cdn' => [
                'type'        => 'text',
                'value'       => $data['cdn'],
                'required'    => false,
                'title'       => '访问目录',
                'placeholder' => '通常为CDN域名+上传目录或/+上传目录',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'size' => [
                'type'        => 'text',
                'value'       => $data['size'],
                'required'    => false,
                'title'       => '上传文件大小限制（MB）',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'ext' => [
                'type'        => 'text',
                'value'       => $data['ext'],
                'required'    => false,
                'title'       => '允许的文件后缀',
                'placeholder' => '如：jpg,png,bmp,jpeg,gif',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'thumb_slide' => [
                'type'        => 'text',
                'value'       => $data['thumb_slide'],
                'required'    => false,
                'title'       => '横版封面缩略图（宽,高,类型）',
                'placeholder' => '如：160,90,1',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'thumb_cover' => [
                'type'        => 'text',
                'value'       => $data['thumb_cover'],
                'required'    => false,
                'title'       => '竖版封面缩略图（宽,高,类型）',
                'placeholder' => '如：160,90,1',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ],
            'thumb_editor' => [
                'type'        => 'text',
                'value'       => $data['thumb_editor'],
                'required'    => false,
                'title'       => '重置编辑器上传图片的大小',
                'placeholder' => '如：800,600,1',
                'class_row'   => 'mb-3',
                'class_label' => 'form-label',
            ]
        ];
    }
}